export function showOpenDialog(options: Electron.OpenDialogOptions): Promise<string[]> {
  return ipc.invoke("dialog:show-open", options);
}

export function showSaveDialog(options: Electron.SaveDialogOptions): Promise<string> {
  return ipc.invoke("dialog:show-save", options);
}

export function showOpenDirectoryDialog(options?: Partial<Electron.OpenDialogOptions>): Promise<string> {
  return showOpenDialog({ ...options, title: "选择目录", properties: ["openDirectory"] }).then(res => res?.[0]);
}

export function showMessageBox(options: Electron.MessageBoxOptions): Promise<Electron.MessageBoxReturnValue> {
  return ipc.invoke("dialog:show-message", options);
}

export function showErrorBox(title: string, content: string): Promise<void> {
  return ipc.invoke("dialog:show-error", title, content);
}
